<?php


namespace app\api\controller\uniapp;


use app\api\controller\Leshua;
use app\api\model\ShopYiwu;
use app\api\model\Users;
use app\api\service\uniapp\order\OrderService;
use app\common\controller\Api;
use app\api\controller\Wxutils;
use app\api\model\Region;
use think\Config;
use think\Db;

/**
 * 小程序订单接口
 * Class Index
 * @package app\api\controller\uniapp
 */
class Order extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];
    protected $service = null;

    public function _initialize()
    {
        parent::_initialize();
        $version = str_replace(".","",$this->version);
        $className = basename(__CLASS__);
        $serviceName = "app\\api\\service\\uniapp\\order\\Order{$version}";
        $this->service = new $serviceName;
    }

    /**
     * 核单列表首页
     * @return mixed
     */
    public function index(){
        return $this->service->load_order();
    }

    /**
     * 订单详情
     * @return mixed
     */
    public function get_order(){
        return $this->service->get_order();
    }

    /**
     * 核销订单
     * @return mixed
     */
    public function verification(){
        return $this->service->verification();
    }

    /**
     * 创建线上订单
     * @return mixed
     */
    public function shoping_order(){
        return $this->service->createShoppingOrder();
    }

    /**
     * 加载单笔所有订单
     * @return mixed
     */
    public function load_all_order(){
        return $this->service->load_all_order();
    }

    /**
     * 线上订单支付
     * @return mixed
     */
    public function gopay(){
        return $this->service->gopay();
    }
}